package com.shouer.doc.ui;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.shouer.doc.R;
import com.shouer.doc.ui.conversation.ConversationActivity;

import io.rong.callkit.IShouerConver;
import io.rong.imkit.RongExtension;
import io.rong.imkit.fragment.ConversationFragment;

/**
 * Created by yangyayun on 2016/12/28.
 */

public class ShouerConversationFragment extends ConversationFragment implements IShouerConver{

    private RongExtension rongExtension;
    private boolean showRongExtension=true;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

        View view=super.onCreateView(inflater,container,savedInstanceState);
        rongExtension= (RongExtension) view.findViewById(R.id.rc_extension);
        if (showRongExtension)
        {
            rongExtension.setVisibility(View.VISIBLE);
        }else
        {
            rongExtension.setVisibility(View.GONE);
        }
        return view;
    }


    public void setShowRongExtension(boolean showRongExtension) {
        this.showRongExtension = showRongExtension;
        if (null!=rongExtension)
        {
            if (showRongExtension)
            {
                rongExtension.setVisibility(View.VISIBLE);
            }else
            {
                rongExtension.setVisibility(View.GONE);
            }
        }
    }

    @Override
    public String getTargetUserId() {
        return ((ConversationActivity)getActivity()).getTargetUserId();
    }

    @Override
    public String getOrderId() {
        return ((ConversationActivity)getActivity()).getOrderId();
    }

    @Override
    public String getPatId() {
        return ((ConversationActivity)getActivity()).getPatId();
    }

    @Override
    public void onVideoClick() {
        ((ConversationActivity)getActivity()).onVideoClick();
    }
}
